<template>
  <view>


    <view class="c_seven">
      <view @click="contribute()">
        <image   src="/static/image/woyaotougao.png"></image>
      </view>
      <view @click="contributeList()">
        <image  src="/static/image/findyou.png"></image>
      </view>
    </view>


<!--    <view class="uni-padding-wrap uni-common-mt">-->
<!--      &lt;!&ndash;		    <button type="warn" @click="contribute()">我要投稿</button>&ndash;&gt;-->
<!--      &lt;!&ndash;			<button type="primary" @click="contributeList()">寻找另外一个你</button>&ndash;&gt;-->
<!--      <button type="primary" @click="download()">最新版卦卦邦APP下载次数：{{downCount}}</button>-->
<!--    </view>-->
<!--    <view style="width:100%; text-align: center;">-->
<!--      <a style="text-decoration:none" href="https://beian.miit.gov.cn/#/Integrated/index">京ICP备2023036300号-1 </a>-->
<!--    </view>-->
  </view>
</template>

<script>
import axios from "axios";

export default {
  created() {
    // 在组件创建时加载数据
    this.getDownCount();
  },
  mounted() {
    // 在组件创建时加载数据
    this.getDownCount();
  },
  onShow() {
    this.getDownCount();
  },
  data() {
    return {
      "downCount": 0
    }
  },
  methods: {
    getDownCount: async function (e) {
      console.log(JSON.stringify(this.form))

      const fetchData = async () => {
        try {
          // console.log("send request...2");
          const response = await axios.get('https://www.zhixiaoyixue.com:86/getDownCount');

          // console.log(response.data);
          this.downCount = response.data.res;
        } catch (error) {
          // console.error('Fetch error:', error);
        }
      };

      // console.log("send request...1");
      try {
        await fetchData();
      } catch (err) {
      }
    },
    addDown: async function (e) {
      console.log(JSON.stringify(this.form))

      const fetchData = async () => {
        try {
          // console.log("send request...2");
          const response = await axios.get('https://www.zhixiaoyixue.com:86/addDown');

          // console.log(response.data);
          this.downCount = response.data.res;
        } catch (error) {
          // console.error('Fetch error:', error);
        }
      };

      // console.log("send request...1");
      try {
        await fetchData();
      } catch (err) {
      }
    },
    contribute() {
      this.$router.push({
        path: '/pages/component/contribute/contribute2'
      })
    },
    contributeList() {
      this.$router.push({
        path: '/pages/component/contributeList/contributeList2'
      })
    },
    download() {
      this.addDown();
      // window.location.href="http://apk.zhixiaoguoxue.com/20241217/f9e76f7316f74c85b01179801f5c96bc.apk";
      window.location.href = "https://www.pgyer.com/QrttupB4";
    }
  }
}
</script>

<style>
button {
  margin-top: 30rpx;
  margin-bottom: 30rpx;
}

.button-sp-area {
  margin: 0 auto;
  width: 60%;
}

.mini-btn {
  margin-right: 10rpx;
}

.content {
  padding: 24rpx;
  position: relative;
  z-index: 9;
  margin-top: -500rpx;
}

.c_seven {
  margin-top: 30rpx;
  display: flex;
  align-items: center;
  justify-content: space-between;

  > view {
    > image {
      width: 345rpx;
      height: 190rpx;
    }
  }
}
</style>
